home *** CD-ROM | disk | FTP | other *** search
/ Dynamic HTML Construction Kit / Dynamic HTML Construction Kit.iso / source_code / tydhtml / dyn.exe / CHAP10 / dyn10_3.txt < prev    next >
Encoding:
Text File  |  1997-10-02  |  3.0 KB  |  89 lines

  1. <HTML>
  2. <HEAD>
  3. </HEAD>
  4. <BODY onload="cycle();">
  5. <H2 ID=sg STYLE="color:Black;">Shell Game</H2>
  6. <IMG SRC="gem.gif" ID=gem BORDER=0
  7.  STYLE="container:positioned;position:absolute;
  8.  TOP:192pt;LEFT:142px;WIDTH:32px;HEIGHT:32px;ZINDEX:0;">
  9. <IMG SRC="walnut.gif" ID=shell1 BORDER=0 onclick="Guess();"
  10.  STYLE="container:positioned;position:absolute;
  11.  TOP:50pt;LEFT:0px;WIDTH:64px;HEIGHT:64px;ZINDEX:1;">
  12. <IMG SRC="walnut.gif" ID=shell2 BORDER=0 onclick="Guess();"
  13.  STYLE="container:positioned;position:absolute;
  14.  TOP:50pt;LEFT:142px;WIDTH:64px;HEIGHT:64px;ZINDEX:2;">
  15. <IMG SRC="walnut.gif" ID=shell3 BORDER=0 onclick="Guess();"
  16.  STYLE="container:positioned;position:absolute;
  17.  TOP:50pt;LEFT:284px;WIDTH:64px;HEIGHT:64px;ZINDEX:3;">
  18. <OBJECT ID="pathone"
  19.         CLASSID="CLSID:E0E3CC60-6A80-11D0-9B40-00A0C903AA7F">
  20. <PARAM NAME=XSeries
  21.         VALUE="0,0;10,126;20,0;30,284;40,0;50,142;60,284;70,142;80,142">
  22. <PARAM NAME=YSeries
  23.         VALUE="0,50;10,176;20,50;30,176;40,50;50,176;60,50;70,176;80,50">
  24. </OBJECT>
  25. <OBJECT ID="pathtwo"
  26.         CLASSID="CLSID:E0E3CC60-6A80-11D0-9B40-00A0C903AA7F">
  27. <PARAM NAME=XSeries
  28.         VALUE="0,142;10,142;20,142;30,142;40,284;50,0;60,0;70,0;80,284">
  29. <PARAM NAME=YSeries
  30.         VALUE="0,50;10,50;20,50;30,176;40,50;50,176;60,50;70,176;80,50">
  31. </OBJECT>
  32. <OBJECT ID="paththree"
  33.         CLASSID="CLSID:E0E3CC60-6A80-11D0-9B40-00A0C903AA7F">
  34. <PARAM NAME=XSeries
  35.         VALUE="0,284;10,284;20,284;30,0;40,142;50,284;60,142;70,284;80,0">
  36. <PARAM NAME=YSeries
  37.         VALUE="0,50;10,50;20,50;30,176;40,50;50,176;60,50;70,176;80,50">
  38. </OBJECT>
  39. <OBJECT ID="pathfour"
  40.         CLASSID="CLSID:E0E3CC60-6A80-11D0-9B40-00A0C903AA7F">
  41. <PARAM NAME=XSeries
  42.         VALUE="0,142;10,142;20,16;30,300;40,16;50,158;60,300;70,158;80,158">
  43. <PARAM NAME=YSeries
  44.         VALUE="0,192;10,192;20,66;30,192;40,66;50,192;60,66;70,192;80,66">
  45. </OBJECT>
  46. <SCRIPT LANGUAGE=VBScript>
  47. function cycle()
  48.         dim itimer
  49.         pathone.Target = shell1.Style
  50.         pathtwo.Target = shell2.Style
  51.         paththree.Target = shell3.Style
  52.         pathfour.Target = gem.Style
  53.         shell1.style.visibility="visible"
  54.         shell2.style.visibility="visible"
  55.         shell3.style.visibility="visible"
  56.         gem.style.visibility="visible"
  57.         pathone.Play
  58.         pathtwo.Play
  59.         paththree.Play
  60.         pathfour.Play
  61.         itimer = setTimeout( "Moves()", 50)
  62. End function
  63.  
  64. Sub Moves
  65.         dim itimer
  66.         pathone.Tick
  67.         pathtwo.Tick
  68.         paththree.Tick
  69.         pathfour.Tick
  70.         if currentTick < 9 then
  71.             itimer = setTimeout("Moves()", 50)
  72.         end if
  73. End Sub
  74. </SCRIPT>
  75.  
  76. <SCRIPT LANGUAGE=VBScript>
  77. function Guess()
  78.   dim r, srcElement
  79.   set srcElement = window.event.srcElement
  80.   if (srcElement.id="shell1") then
  81.      srcElement.src = "gem.gif"
  82.   else
  83.      srcElement.src = "wrong.gif"
  84.   end if
  85. end function
  86. </SCRIPT>
  87. </BODY>
  88. </HTML>
  89.